/*
 * Niiuzu
 * Copyright (C) 2011  Thierry Nowak
 * 
 * This program is free software: you can redistribute it and/or modify it under
 * the terms of the GNU General Public License as published by the Free Software
 * Foundation, either version 3 of the License, or (at your option) any later
 * version.
 * 
 * This program is distributed in the hope that it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
 * FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
 * details.
 * 
 * You should have received a copy of the GNU General Public License along with
 * this program.  If not, see <http://www.gnu.org/licenses/>.
 */
package com.niiuzu.client.util.widget;

import com.google.gwt.core.client.GWT;
import com.google.gwt.uibinder.client.UiBinder;
import com.google.gwt.uibinder.client.UiField;
import com.google.gwt.user.client.ui.Composite;
import com.google.gwt.user.client.ui.HTML;
import com.google.gwt.user.client.ui.HasHTML;
import com.google.gwt.user.client.ui.HasText;
import com.google.gwt.user.client.ui.Widget;

/**
 * Cette {@link Widget} indique à l'utilisateur qu'un chargement est en cours et
 * lui permet de patienter.
 */
public class LoadingBox extends Composite implements HasText, HasHTML {

	/**
	 * Interface {@link UiBinder} adaptée à la widget {@link LoadingBox}.
	 */
	interface SuitedUiBinder extends UiBinder<Widget, LoadingBox> {

	}

	@UiField
	HTML message;

	/**
	 * Construit une nouvelle instance de {@link LoadingBox}.
	 */
	public LoadingBox() {
		SuitedUiBinder uiBinder = GWT.create(SuitedUiBinder.class);
		initWidget(uiBinder.createAndBindUi(this));
	}

	@Override
	public String getText() {
		return message.getText();
	}

	@Override
	public void setText(String text) {
		message.setText(text);
	}

	@Override
	public String getHTML() {
		return message.getHTML();
	}

	@Override
	public void setHTML(String html) {
		message.setHTML(html);
	}

}
